'''
20250808

/mnt/nas/shengjie/datasets/dataset_depth_control_4000

构建 json
['data'] = [{ 'img_path' },...]

训练 depth control 
基于 depth_control


'''
dir = '/mnt/nas/shengjie/datasets/dataset_depth_control'

save_json_file = 'data_depth_control_50k.json'

save_data = dict()
save_data['data'] = []

from util_for_os import osj,ose

with open( osj(dir , 'names.txt') ) as f:
    names = f.readlines()

from tqdm import tqdm
for name in tqdm(names):
    if not name.strip().endswith('.jpg'):continue

    save_data['data'].append( {
        'img_path': osj(  dir , name.strip() )
    } )

# import pdb
# pdb.set_trace()

import json
with open(save_json_file,'w',encoding='utf-8') as f:
    json.dump( save_data , f , ensure_ascii=False , indent=2 )